//
//  UserMessageCell.m
//  jinwang
//
//  Created by jzb on 2018/3/24.
//  Copyright © 2018年 jzb. All rights reserved.
//

#import "UserMessageCell.h"

@implementation UserMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setModel:(UserMessageModel *)model{
    
    _model = model;
    
    self.user_nickname.text = [NSString stringWithFormat:@"昵称：%@",model.user_nickname];
    self.user_truename.text = [NSString stringWithFormat:@"姓名：%@",model.user_truename];
    [self.HeaderImg sd_setImageWithURL:[NSURL URLWithString:model.user_portrait] placeholderImage:[UIImage imageNamed:@"headerImage"]];
    
    if ([model.user_sex integerValue] == 0) {
        self.user_sexImg.image = [UIImage imageNamed:@"jw_men_Icon"];
    }else{
        self.user_sexImg.image = [UIImage imageNamed:@"jw_Women_Icon"];
    }
    if (model.tag.count > 0) {
        
        NSString *tags = [model.tag componentsJoinedByString:@"  "];
        self.user_tagsLabel.text = [NSString stringWithFormat:@"关系：%@",tags];
    }
   if ([model.is_follow integerValue] == 1){
        
        self.GuanZhuBtn.userInteractionEnabled=NO;
        [self.GuanZhuBtn setTitle:@"已关注" forState:UIControlStateNormal];
        self.GuanZhuBtn.backgroundColor = [UIColor colorWithRed:238/255.0 green:167/255.0 blue:43/255.0 alpha:0.7];
    }
    if (model.status.length > 0 && [model.status isEqualToString:@"offline"]) {
        
        self.user_phone.text = [NSString stringWithFormat:@"在线  %@",model.distance];
    }else{
        
        self.user_phone.text = [NSString stringWithFormat:@"离线  %@",model.distance];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
